package com.epam.kozich.dao;

import java.util.List;

import org.hibernate.criterion.Example;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.epam.kozich.model.Book;
import com.epam.kozich.model.Order;
import com.epam.kozich.model.Person;

public class OrderDAOImpl extends HibernateDaoSupport implements OrderDAO {

	public void delete(Order order) {
	}

	public void save(Order order) {
		getHibernateTemplate().save(order);
	}

	public void update(Order order) {
	}

	public void addBookInOrder(Book book) {
		// TODO Auto-generated method stub

	}

	public void listOrderFromUser(Person person) {
	
		person.getId();

		List results = getSession().createCriteria(Order.class).add(
				Example.create(person.getId())).list();
	}

}
